package com.controller;


import com.github.pagehelper.PageInfo;
import com.pojo.Notice;
import com.service.SiteService;
import com.vo.NoticeVo;
import com.vo.Result;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/Site")
public class NoticeController {
    @Resource
    private SiteService siteService;

    @RequestMapping("/Notice/index")
    public String toSite(){
        return "/Site/Notice";
    }

    @RequestMapping("/Notice/selectnotice")
    @ResponseBody
    public Result selectNotice(@RequestBody NoticeVo noticeVo){
        noticeVo.setNotice(1);

        PageInfo<Notice> selectnotice = siteService.selectnotice(noticeVo);
        return Result.success(selectnotice);
    }


}
